﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Rechargeable.Migrations
{
    public partial class product_v3 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "AppProductPrices",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    ProductId = table.Column<Guid>(nullable: false),
                    Money = table.Column<decimal>(nullable: false),
                    Day = table.Column<int>(nullable: false),
                    Desc = table.Column<string>(maxLength: 256, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AppProductPrices", x => x.Id);
                    table.ForeignKey(
                        name: "FK_AppProductPrices_AppProducts_ProductId",
                        column: x => x.ProductId,
                        principalTable: "AppProducts",
                        principalColumn: "Id",
                        onDelete: ReferentialAction.Cascade);
                });

            migrationBuilder.CreateIndex(
                name: "IX_AppProductPrices_ProductId",
                table: "AppProductPrices",
                column: "ProductId");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "AppProductPrices");
        }
    }
}
